// pages/jianzhi/jianzhi.js
const db = wx.cloud.database().collection("shichang")
Page({
  data: {
    listData: []
  },
  onShow: function () {
    this.getData ()
  },
  getData () { // 获取数据
    let thiss = this
    var listData = []
    db.get({
      success (res) {
        for (let i=0; i<res.data.length; i++) {
          if (res.data[i]._openid === wx.getStorageSync("open")) {
            listData.push(res.data[i])
          }
        }
        thiss.setData({
          listData
        })
      }
    })
  }
})